import { baseUrl} from './config.js';

export function topList(){
	
	return new Promise(function(resolve,reject){
		uni.request({
			url: `${baseUrl}/toplist/detail`,
			method:"GET",
			data:{},
			success(res) {
				// console.log(res)
				let result = res.data.list
				result.length = 4   // 只去前面四项
				resolve(result)
			}
		})
	}
	)
}

export function  list(listId){
	return uni.request({
		url: `${baseUrl}/top/list?id=${listId}`,
		method: 'GET'
	});
}